// 全局样式
@import '@/assets/fonts/aibadaokai/font.scss';

::-webkit-scrollbar {
    width: 13px;
    height: 13px;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.4);
    background-clip: padding-box;
    border: 3px solid transparent;
    border-radius: 7px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-track:hover {
    background-color: #f8fafc;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: #333;
    background-color: $g-app-bg;
    box-sizing: border-box;
    font-family: 'myFont';
    -webkit-tap-highlight-color: transparent;

    &.hidden {
        overflow: hidden;
    }
}

* {
    box-sizing: inherit;
}

// 右侧内容区针对fixed元素，有横向铺满的需求，可在fixed元素上设置 [data-fixed-calc-width]
[data-fixed-calc-width] {
    position: fixed;
    left: 50%;
    right: 0;
}

[data-app-width-mode='adaption'] {
    [data-fixed-calc-width] {
        width: calc(100% - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
    }

    &[data-menu-mode='only-side'] {
        [data-fixed-calc-width] {
            width: calc(100% - #{$g-main-sidebar-width});
            transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2));
        }
    }

    &[data-menu-mode='only-head'] {
        [data-fixed-calc-width] {
            width: 100%;
            transform: translateX(-50%);
        }
    }

    &[data-sidebar-no-collapse] {
        [data-fixed-calc-width] {
            transform:
                translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(division($g-sub-sidebar-width, 2));
        }

        &[data-menu-mode='head'],
        &[data-menu-mode='single'] {
            [data-fixed-calc-width] {
                width: calc(100% - #{$g-sub-sidebar-width});
                transform: translateX(-50%) translateX(division($g-sub-sidebar-width, 2));
            }
        }
    }

    &[data-sidebar-collapse] {
        [data-fixed-calc-width] {
            width: calc(100% - #{$g-main-sidebar-width} - 64px);
            transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(32px);
        }

        &[data-menu-mode='head'],
        &[data-menu-mode='single'] {
            [data-fixed-calc-width] {
                width: calc(100% - 64px);
                transform: translateX(-50%) translateX(32px);
            }
        }
    }
}

[data-app-width-mode='adaption-min-width'] {
    [data-fixed-calc-width] {
        width: calc(100% - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
    }

    &[data-menu-mode='only-side'] {
        [data-fixed-calc-width] {
            width: calc(100% - #{$g-main-sidebar-width});
            transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2));
        }
    }

    &[data-menu-mode='only-head'] {
        [data-fixed-calc-width] {
            width: 100%;
            transform: translateX(-50%);
        }
    }

    &[data-sidebar-no-collapse] {
        [data-fixed-calc-width] {
            transform:
                translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(division($g-sub-sidebar-width, 2));
        }

        &[data-menu-mode='head'],
        &[data-menu-mode='single'] {
            [data-fixed-calc-width] {
                width: calc(100% - #{$g-sub-sidebar-width});
                transform: translateX(-50%) translateX(division($g-sub-sidebar-width, 2));
            }
        }
    }

    &[data-sidebar-collapse] {
        [data-fixed-calc-width] {
            width: calc(100% - #{$g-main-sidebar-width} - 64px);
            transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(32px);
        }

        &[data-menu-mode='head'],
        &[data-menu-mode='single'] {
            [data-fixed-calc-width] {
                width: calc(100% - 64px);
                transform: translateX(-50%) translateX(32px);
            }
        }
    }
}

[data-app-width-mode='center'] {
    [data-fixed-calc-width] {
        width: calc(#{$g-app-width} - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
    }

    &[data-menu-mode='only-side'] {
        [data-fixed-calc-width] {
            width: calc(#{$g-app-width} - #{$g-main-sidebar-width});
            transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2));
        }
    }

    &[data-menu-mode='only-head'] {
        [data-fixed-calc-width] {
            width: $g-app-width;
            transform: translateX(-50%);
        }
    }

    &[data-sidebar-no-collapse] {
        [data-fixed-calc-width] {
            transform:
                translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(division($g-sub-sidebar-width, 2));
        }

        &[data-menu-mode='head'],
        &[data-menu-mode='single'] {
            [data-fixed-calc-width] {
                width: calc(#{$g-app-width} - #{$g-sub-sidebar-width});
                transform: translateX(-50%) translateX(division($g-sub-sidebar-width, 2));
            }
        }
    }

    &[data-sidebar-collapse] {
        [data-fixed-calc-width] {
            width: calc(#{$g-app-width} - #{$g-main-sidebar-width} - 64px);
            transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(32px);
        }

        &[data-menu-mode='head'],
        &[data-menu-mode='single'] {
            [data-fixed-calc-width] {
                width: calc(#{$g-app-width} - 64px);
                transform: translateX(-50%) translateX(32px);
            }
        }
    }
}

[data-app-width-mode='center-max-width'] {
    [data-fixed-calc-width] {
        width: calc(#{$g-app-width} - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
    }

    &[data-menu-mode='only-side'] {
        [data-fixed-calc-width] {
            width: calc(#{$g-app-width} - #{$g-main-sidebar-width});
            transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2));
        }
    }

    &[data-menu-mode='only-head'] {
        [data-fixed-calc-width] {
            width: $g-app-width;
            transform: translateX(-50%);
        }
    }

    &[data-sidebar-no-collapse] {
        [data-fixed-calc-width] {
            transform:
                translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(division($g-sub-sidebar-width, 2));
        }

        &[data-menu-mode='head'],
        &[data-menu-mode='single'] {
            [data-fixed-calc-width] {
                width: calc(#{$g-app-width} - #{$g-sub-sidebar-width});
                transform: translateX(-50%) translateX(division($g-sub-sidebar-width, 2));
            }
        }
    }

    &[data-sidebar-collapse] {
        [data-fixed-calc-width] {
            width: calc(#{$g-app-width} - #{$g-main-sidebar-width} - 64px);
            transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(32px);
        }

        &[data-menu-mode='head'],
        &[data-menu-mode='single'] {
            [data-fixed-calc-width] {
                width: calc(#{$g-app-width} - 64px);
                transform: translateX(-50%) translateX(32px);
            }
        }
    }
}

[data-app-width-mode='center'],
[data-app-width-mode='center-max-width'] {
    @media screen and (max-width: $g-app-width) {
        [data-fixed-calc-width] {
            width: calc(100% - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
        }

        &[data-menu-mode='only-side'] {
            [data-fixed-calc-width] {
                width: calc(100% - #{$g-main-sidebar-width});
                transform: translateX(-50%) translateX(division($g-main-sidebar-width, 2));
            }
        }

        &[data-menu-mode='only-head'] {
            [data-fixed-calc-width] {
                width: 100%;
                transform: translateX(-50%);
            }
        }

        &[data-sidebar-no-collapse] {
            [data-fixed-calc-width] {
                transform:
                    translateX(-50%) translateX(division($g-main-sidebar-width, 2)) translateX(division($g-sub-sidebar-width, 2));
            }

            &[data-menu-mode='head'],
            &[data-menu-mode='single'] {
                [data-fixed-calc-width] {
                    width: calc(100% - #{$g-sub-sidebar-width});
                    transform: translateX(-50%) translateX(division($g-sub-sidebar-width, 2));
                }
            }
        }

        &[data-sidebar-collapse] {
            [data-fixed-calc-width] {
                width: calc(100% - #{$g-main-sidebar-width} - 64px);
            }

            &[data-menu-mode='head'],
            &[data-menu-mode='single'] {
                [data-fixed-calc-width] {
                    width: calc(100% - 64px);
                }
            }
        }
    }
}

[data-mode='mobile'] {
    [data-fixed-calc-width] {
        width: 100% !important;
        transform: translateX(-50%) !important;
    }
}

// remix icon
[class^='ri-'],
[class*=' ri-'] {
    display: inline-block;
    vertical-align: bottom;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
}

.el-button [class*='ri-']+span {
    margin-left: 5px;
}

// textarea 字体跟随系统
textarea {
    font-family: inherit;
}

// 列表页全局样式
.el-table.list-table {
    margin: 20px 0;

    .el-button+.el-dropdown {
        margin-left: 10px;
    }
}

// .el-menu {
//     @include themeify {
//         background-color: themed('g-sub-sidebar-bg');
//     }

//     .el-menu--inline {
//         @include themeify {
//             background-color: themed('g-sub-sidebar-menu-bg') !important;
//         }

//         .el-menu-item,
//         .el-sub-menu>.el-sub-menu__title {
//             @include themeify {
//                 color: themed('g-sub-sidebar-menu-color');
//                 background-color: themed('g-sub-sidebar-menu-bg') !important;
//             }

//             &:hover {
//                 @include themeify {
//                     color: themed('g-sub-sidebar-menu-hover-color') !important;
//                     background-color: themed('g-sub-sidebar-menu-hover-bg') !important;
//                 }
//             }
//         }
//     }
// }

// .el-menu-item,
// .el-sub-menu__title {
//     @include themeify {
//         color: themed('g-sub-sidebar-menu-color') !important;
//         background: transparent !important;
//     }

//     &:hover {
//         @include themeify {
//             color: themed('g-sub-sidebar-menu-hover-color') !important;
//             background-color: themed('g-sub-sidebar-menu-hover-bg') !important;
//         }
//     }

//     i,
//     .icon,
//     .el-sub-menu__icon-arrow {
//         color: unset;
//     }
// }

// .el-menu-item.is-active,
// .el-menu--collapse .el-sub-menu.is-active>.el-sub-menu__title,
// .el-popper .el-sub-menu.is-active>.el-sub-menu__title,
// .el-sub-menu .el-menu--inline .el-menu-item.is-active {
//     @include themeify {
//         color: themed('g-sub-sidebar-menu-active-color') !important;
//         background-color: themed('g-sub-sidebar-menu-active-bg') !important;
//     }

//     i,
//     .icon,
//     .el-sub-menu__icon-arrow {
//         color: unset;
//     }
// }
.el-popper {

    >.el-menu--vertical,
    >.el-menu--horizontal {
        max-width: 200px;

        .el-menu--popup {
            @include themeify {
                background-color: themed('g-sub-sidebar-bg') !important;
            }
        }
    }
}

.tooltip-style {
    border: 1px solid #fff !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
}

.df {
    display: flex;
}

.aic {
    align-items: center;
}

.jcc {
    justify-content: center;
}

.jcsb {
    justify-content: space-between;
}

.fdc {
    flex-direction: column;
}


/*  dialog*/
.el-dialog {
    position: relative;
}

.avue-crud__dialog__menu {
    position: absolute;
    right: 30px;
    top: 22px;
    padding-right: 20px;
    float: left;
}

.quan {
    width: 18px;
    height: 18px;
    cursor: pointer;
}